/**
 * platforms
 *
 * @author xiaomi
 */
'use strict';

const PLATFORMS = {
    TAOBAO: {
        id: 1,
        name: '淘宝',
        alias: 'TAOBAO',
        priority: 1
    },
    WECHAT_BUSINESS: {
        id: 2,
        name: '微商',
        alias: 'WECHAT_BUSINESS',
        priority: 1
    },
    VISITING_CARD: {
        id: 4,
        name: '名片',
        alias: 'VISITING_CARD',
        priority: 1
    },
    WECHAT_PUBLIC: {
        id: 8,
        name: '公众号',
        alias: 'WECHAT_PUBLIC',
        priority: 1
    }
};

// items
let items = Object.keys(PLATFORMS)
    .map(k => PLATFORMS[k])
    .sort((a, b) => {
        return b.priority - a.priority;
    });

Object.defineProperty(PLATFORMS, '_items', {
    configurable: true,
    enumerable: false,
    value: items
});

module.exports = PLATFORMS;
